import request from '@/utils/request'
// 增加
export function addSetting(data) {
  return request({
    url: '/sys/role',
    method: 'post',
    data
  })
}
// 获得全部
export function getSetting(params) {
  return request({
    url: '/sys/role',
    method: 'get',
    params
  })
}
// 修改
export function updatSetting(data) {
  return request({
    url: `/sys/role/${data.id}`,
    method: 'put',
    data
  })
}
// 删除
export function deleSetting(id) {
  return request({
    url: `/sys/role/${id}`,
    method: 'delete'
  })
}
// 获取指定的角色
export function getupSetting(id) {
  return request({
    url: `/sys/role/${id}`,
    method: 'get'
  })
}
// 分配权限
export function assignSetting(data) {
  return request({
    url: `/sys/role/assignPrem`,
    method: 'put',
    data
  })
}
export function getRoles(params) {
  return request({
    url: '/sys/role',
    method: 'GET',
    params: params
  })
}
export function getRoleDetail(id) {
  return request({
    url: `/sys/role/${id}`
  })
}
export function assignPerm(data) {
  return request({
    url: '/sys/role/assignPrem',
    method: 'put',
    data
  })
}
